package xdu.ble.user.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author com.alibaba.lizhen
 * @Date 2021/1/13 7:49 下午
 * @Version 1.0
 * @Description 管理员表
 */
@Table(name = "hospital_patient_info")
@Data
public class Patient implements Serializable {


    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    //手环id
    private String wristId;

    @Length(min = 2,max = 10,message = "名字只能在2-10位之间")
    private String userName;

    @Length(min = 18,max = 18,message = "身份证有误")
    private String idCard;

    @Pattern(regexp = "^1[35678]\\d{9}$",message = "手机格式有误")
    private String phoneNum;


    private String diseaseCode;


    //激活时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date activeTime;

    //是否康复
    private String isRecovery;

    //康复时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date recoveryTime;

    //所属管理员
    @Pattern(regexp = "^1[35678]\\d{9}$",message = "手机格式有误")
    private String managerPhone;


    //所属房间号
    private String room;


}
